/**
 * 学校自定义数据存储
 */
var cksData = {
	sid:0,
	modules:new Array(),	//模块
	defaultModules:new Array(), //系统模块模板
	moduleIndex:'',  //2,3,1|4,5
	quit:false,
	
	tmpData:{"notice":"","noticeEdit":"false","bigLogo":"","middleLogo":"","smallLogo":"","typeList":"","typeListEdit":"false","bannerId":"","bannerUrl":"","template":""},	//临时数据
	
	editMode:false,		//是否进入编辑模式
	
	get:function(k) {
		return this[k];
	},
	
	set:function(k, v) {
		this[k] = v;
	},
	
	/**
	 * 初始化数据
	 */
	initData:function(d) {
		this.sid = d.SID;
		this.modules = d.Modules;
		this.defaultModules = d.DefaultModules;
		
		//初始化moduleIndex
		var leftModules = new Array(),
			rightModules = new Array();
		$.each(d.Modules, function(k, v){
			if (v.position == 'left') {
				leftModules.push(k);
			} else {
				rightModules.push(k);
			}
		});
		this.moduleIndex = leftModules.join(",")+"|"+rightModules.join(",");
	}	
};